home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / cutpaste.lbr / CUT.DQC / CUT.DOC
Encoding:
Text File  |  1985-06-03  |  5.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                       (last mod. 8/19/84)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      CCCCUUUUTTTT((((1111))))             UUUUNNNNIIIIXXXX 4444....0000            CCCCUUUUTTTT((((1111))))
  71.  
  72.  
  73.  
  74.      NNNNAAAAMMMMEEEE
  75.       cut -    cut out    selected fields    of each    line of    a file
  76.  
  77.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  78.       ccccuuuutttt ----cccclist [file1 file2 ...]
  79.       ccccuuuutttt ----fffflist [----dddd char] [----ssss] [file1 file2 ...]
  80.  
  81.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  82.       Use _c_u_t to cut out columns from a table or fields from each
  83.       line of a file; in data base parlance, it implements the
  84.       projection of    a relation.  The fields    as specified by    _l_i_s_t
  85.       can be fixed length, i.e., character positions as on a
  86.       punched card (----cccc option), or the length can vary from    line
  87.       to line and be marked    with a field delimiter character like
  88.       _t_a_b (----ffff option).  _C_u_t    can be used as a filter; if no files
  89.       are given, the standard input    is used.
  90.  
  91.       The meanings of the options are:
  92.  
  93.       _l_i_s_t
  94.        A comma-separated list of integer field numbers (in
  95.        increasing order), with optional - to indicate ranges as in
  96.        the ----oooo option of _n_r_o_f_f/_t_r_o_f_f    for page ranges; e.g., 1111,,,,4444,,,,5555;
  97.        1111----3333,,,,8888; ----5555,,,,11110000    (short for 1111----5555,,,,11110000PPPP))));;;; oooorrrr    3333---- ((((sssshhhhoooorrrrtttt ffffoooorrrr tttthhhhiiiirrrrdddd
  98.        tttthhhhrrrroooouuuugggghhhh llllaaaasssstttt    ffffiiiieeeelllldddd))))....
  99.  
  100.       ----cccc_l_i_s_t
  101.        The _l_i_s_t following ----cccc (no space) specifies character
  102.        positions (e.g., ----cccc1111----77772222 would pass the first    72 characters
  103.        of each line).
  104.  
  105.       ----ffff_l_i_s_t
  106.        The _l_i_s_t following ----ffff is a list of fields assumed to    be
  107.        separated in    the file by a delimiter    character (see ----dddd);
  108.        e.g., ----ffff1111,,,,7777 copies the first    and seventh field only.     Lines
  109.        with    no field delimiters will be passed through intact
  110.        (useful for table subheadings), unless ----ssss is    specified.
  111.  
  112.       ----dddd_c_h_a_r
  113.        The character following ----dddd is the field delimiter (----ffff
  114.        option only).  Default is _t_a_b.  Space or other characters
  115.        with    special    meaning    to the shell must be quoted.
  116.  
  117.       ----ssss
  118.        Supresses lines with    no delimiter characters    in case    of ----ffff
  119.        option.  Unless specified, lines with no delimiters will be
  120.        passed through untouched.
  121.  
  122.       Either the ----cccc    or ----ffff option must be specified.
  123.  
  124.      HHHHIIIINNNNTTTTSSSS
  125.       Use _g_r_e_p(1) to make horizontal "cuts"    (by context) through a
  126.  
  127.  
  128.  
  129.      Page 1                       (last mod. 8/19/84)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      CCCCUUUUTTTT((((1111))))             UUUUNNNNIIIIXXXX 4444....0000            CCCCUUUUTTTT((((1111))))
  137.  
  138.  
  139.  
  140.       file or _p_a_s_t_e(1) to put files    together column-wise (i.e.,
  141.       horizontally).  To reorder columns in    a table, use _c_u_t and
  142.       _p_a_s_t_e.
  143.  
  144.      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  145.       cut -d: -f1,5    /etc/passwd
  146.         mapping of user IDs    to names
  147.  
  148.       name=`who am icut -f1    -d
  149.         to set nnnnaaaammmmeeee    to current login name
  150.  
  151.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  152.       _l_i_n_e _t_o_o _l_o_n_g
  153.         A line can have no more than 511 characters    or fields.
  154.  
  155.       _b_a_d _l_i_s_t _f_o_r _c/_f _o_p_t_i_o_n
  156.         Missing ----cccc or ----ffff option or incorrectly specified _l_i_s_t.  No
  157.         error occurs if a line has fewer fields than the _l_i_s_t
  158.         calls for.
  159.  
  160.       _n_o _f_i_e_l_d_s
  161.         The    _l_i_s_t is    empty.
  162.  
  163.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  164.       grep(1),paste(1).
  165.  
  166.      CCCCAAAAVVVVEEEEAAAATTTTSSSS
  167.       This program is a complete rewrite of    the Bell Laboratories
  168.       command of the same name; no part of the original source or
  169.       manual is included.  Therefore, you may feel free to use it,
  170.       and its source, without violation of any contract
  171.       agreements.  However,    I retain the copyright in order    to
  172.       specify it remain available for use by all and sundry,
  173.       without cost.     Feel free to modify as    necessary, although I
  174.       went to great    pains to recreate the behavior of the original
  175.       command; I would suggest this    congruence be maintained.
  176.  
  177.       Along    the same lines,    although I've made a reasonable    effort
  178.       to test the more arcane behavior of the original _c_u_t and
  179.       reproduce it,    there are no guarantees.  I remain in no way
  180.       liable for any loss, either explicit or incidental, that may
  181.       be incurred through use of this command.  I do ask that any
  182.       bugs (and, hopefully,    fixes) be reported back    to me as
  183.       encountered. - David M. Ihnat, ihuxx!ignatz
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 2                       (last mod. 8/19/84)
  196.  
  197.  
  198.  
  199.